MiniAda is a small educational compiler. Some have called it “The Visible Compiler” because it uses animation and pictures to show you what goes on inside a compiler while it is translating a source program into object code.
To Run MiniAda
Open MiniAda from the Finder, and click the “Go” button. MiniAda will remind you that you need to specify a source program. Click “OK” and a list of source files for MiniAda will appear in the standard file window. Select “Sample.Ada” and open it. Then click “Go” again, and you can watch MiniAda compile the program “Sample.Ada.”
By choosing the “Settings...” command from the “Controls” menu, you can specify settings. For example, you can change MiniAda’s speed and you can get it to trace its actions or stop at various places. When it is stopped, you can use the “Step” button to get a “blow-by-blow” view of what is going on.
If you choose “Lexical Analyzer” on the “Windows” menu, you get to see an animated diagram of the finite state automaton MiniAda uses to recognize “lexemes” in the source program. (Lexemes are identifiers, numbers, operators, and punctuation marks.) After displaying the Lexical Analyzer diagram, click anywhere in the top window to get the “Go” and “Step” buttons to reappear. Then click “Go” or “Step” to start the Lexical Analyzer.
Writing Your Own MiniAda Programs
You can write MiniAda programs using MacWrite or any text editor that can create “TEXT” files. Click the “Text Only” radio button in MacWrite when you do a “Save As...” since MiniAda can accept only pure “TEXT” files.
The syntax of the MiniAda language is given by the railroad diagrams shown below. In these diagrams, an “Integer” is a sequence of digits, and an “Identifier” is any sequence of letters or digits beginning with a letter. All letters in MiniAda have to be in lower case.
In these railroad diagrams, the following abbreviations are used: ID = Identifier, E = Expression, COND = Condition, and SL = Statement List.
Understanding the Target Code
MiniAda produces target instructions for a simple computer with a single accumulator, “Acc.” The instruction “LOAD 2000” moves the contents of memory location 2000 into the accumulator. Similarly, the instruction “STORE 2000” stores the contents of the accumulator into the location in memory whose address is 2000. The instruction “ADD 2000” adds the contents of location 2000 to the contents of the accumulator and stores the sum back in the accumulator {Acc := (Acc)+(2000)}, whereas “DIV 2000” divides the contents of the accumulator by the contents of location 2000 and stores the integer quotient back in the accumulator {Acc := (Acc)/(2000)}. (The remainder is thrown away.) The Boolean value “TRUE” is represented by 1. “FALSE” is represented by 0. An instruction such as “GR 2000” compares the contents of the accumulator with the contents of location 2000, and if (Acc)>(2000), the accumulator is set to 1 (or TRUE), otherwise it is set to 0 (or FALSE). The instruction “SKIPT” skips the next instruction if the accumulator contains TRUE, whereas “SKIPF” skips the next instruction if the accumulator contains FALSE.
For Further Information
For further information on MiniAda, you can request an information sheet from: “Andromeda, 3018 Mountain View Drive, Laguna Beach, California 92651.”
Also, you can order disks and a manual from Andromeda. One of the disks contains the executable Macintosh programs for MiniAda, SmallGol, and SmallEdit. SmallGol is another small educational compiler (even smaller than MiniAda), and SmallEdit is a tiny text editor you can use to create programs for MiniAda and SmallGol. All of these programs run on single-drive 128K Macs, 512K Macs, and Mac XL’s under MacWorks. The manual provides an explanation of how SmallGol works, as well as the complete 3000-line Macintosh cross-referenced source program listing for SmallGol — written in Lisa Pascal. Another disk is available with complete Lisa Pascal source files for both MiniAda and SmallGol. You need the Lisa Pascal Workshop 3.9 (with the May 1985 Software Supplement) in order to be able to compile these programs. Neither of the disks is copy protected.
While the MiniAda program can be downloaded for free, there are charges of $25 apiece (plus 6% tax for California residents) for each of: (1) The SmallGol Manual + disk with SmallGol, MiniAda, and SmallEdit, and (2) the disk with Lisa Pascal source listings for MiniAda and SmallGol.